import http from "../utils/http"
import { FEED_API } from "../config"
//1.输入物料SKU，获取明细
export const getSkuDeatil = (productionLine, material) => {
    return http.post(`${FEED_API}/GetReworkMaterial`, {
        Line: productionLine,
        ProductId: material
    }).then(res => res.data)
}
//2.获取桶的明细
export const getbucketDeatil = (bucketno) => {
    return http.post(`${FEED_API}/CheckBucketCode`, {
        BucketCode: bucketno
    }).then(res => res.data)
}
//3.提交
export const SubmitInStorage = (name, line, id, it, normal) => {
    return http.post(`${FEED_API}/ReworkInStorage`, {
        UserAccount: name,
        Line: line,
        ProductId: id,
        Items: it,
        IsNormal: normal
    }).then(res => res.data)
}
//返工查询工单
/* export const getReWorkSearchList = (line, startdate, enddate) => {
    return http.post(`${FEED_API}/GetProcessOrderList`, {
        Line: line,
        StartDate: startdate,
        EndDate: enddate
    }).then(res => res.data)
} */
export const getReWorkSearchList = (line) => {
    return http.post(`${FEED_API}/GetPlanFinishedProductRecord`, {
        Line: line,
    }).then(res => res.data)
}
//获取盘存列表
export const GetReturnStockList = (line) => {
    return http.post(`${FEED_API}/GetReturnStockCheckList`, {
        Line: line
    }).then(res => res.data)
}
//获取当前桶内的信息
export const getbucketInList = (line, bucketno) => {
    return http.post(`${FEED_API}/GetReturnStockRealDetail`, {
        Line: line,
        BucketCode: bucketno
    }).then(res => res.data)
}
//盘存提交
export const StockSubmit = (id, item) => {
    return http.post(`${FEED_API}/StockCheckSure`, {
        BillId: id,
        Items: item
    }).then(res => res.data)
}
//特殊投料密码
export const GetPassword = () => {
    return http.get(`${FEED_API}/GetAccreditPwd`).then(res => res.data)
}

//士力架返工收货
export const GetSLJBucketList = (line, type) => {
    return http.post(`${FEED_API}/GetGetBucketList`, {
        Line: line,
        type: type
    }).then(res => res.data)
}